public class Test4 extends Animal1 {
    public Test4(int a, String name) {
        super(a, name);
    }

    public void eat() {
        System.out.println(name+"吃骨头");
    }

    public static void main(String[] args) {
        Animal1 test = new Cat(1,"f");
    }
    public static void main1(String[] args) {
        //Test4 test = new Animal1(1,"ef");
        Animal1 test1 = new Test4(1,"旺财");
        Animal1 test2 = new CatTest(1,"元宝");
        Animal1 test3 = new Animal1(1,"小动物");

        test1.eat();
        test2.eat();
        test3.eat();
    }
}
class Animal1 {
    int a =0;
    public String name;

    public Animal1(int a, String name) {
        this.a = a;
        this.name = name;
    }
    public void eat() {
        System.out.println(name+"吃饭");
    }
}
class CatTest extends Animal1{
    public CatTest(int a, String name) {
        super(a, name);
    }
    public void eat() {
        System.out.println(name+"吃鱼");
    }
}
class Cat extends CatTest {
    public Cat(int a, String name) {
        super(a, name);
    }
}